<template>
    <div>
         <button @click='computed' id='btn'>-</button><span>{{countindex}}</span><button @click='addcomputed'>+</button>
    </div>
</template>

<script>
export default {
    data(){
        return{
            countindex:1
        }
    },
    mounted(){
       
    },
    methods:{
       computed(){ 
            if(this.countindex>0){
                this.countindex--;
            }    
            this.$emit('reduce')    
       },
       addcomputed(){
           this.countindex++;
           this.$emit('componentreduce')
       }
   }
}
</script>

<style scoped>

</style>